﻿<UserControl x:Name="HashCtrl" x:Class="AppController.HashFileControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="200" d:DesignWidth="300">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="ThemeDark.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <ListView x:Name="hashList" ItemsSource="{Binding HashedFiles.Items}">
        <ListView.Resources>
            <Style TargetType="GridViewColumnHeader" BasedOn="{StaticResource darkHeader}"/>
            <Style TargetType="ListView" BasedOn="{StaticResource darkListView}"/>
        </ListView.Resources>
        <ListView.View>
            <GridView>
                <GridView.Columns>
                    <GridViewColumn Header="File name" DisplayMemberBinding="{Binding FileName, Mode=OneWay}"/>
                    <GridViewColumn Header="Stored hash" DisplayMemberBinding="{Binding StoredHashToHex, Mode=OneWay}"/>
                    <GridViewColumn Header="Actual hash" DisplayMemberBinding="{Binding ActualHashToHex, Mode=OneWay}"/>
                </GridView.Columns>
            </GridView>
        </ListView.View>
        <ListView.ItemContainerStyle>
            <Style TargetType="ListViewItem">
                <Setter Property="FontFamily" Value="Lucida Console"/>
                <Setter Property="FontSize" Value="12"/>
                <Setter Property="Margin" Value="0"/>
                <Setter Property="Focusable" Value="false"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsOriginalMatch}" Value="true">
                        <Setter Property="Foreground" Value="Chartreuse"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsRenamedMatch}" Value="true">
                        <Setter Property="Foreground" Value="Yellow"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding NotFoundOrNotMatch}" Value="true">
                        <Setter Property="Foreground" Value="Red"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </ListView.ItemContainerStyle>
    </ListView>
</UserControl>
